<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"[]>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Evaluations</title>
        <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" />
        <!--[if IE 6]><link rel="stylesheet" href="../css/style.ie6.css" type="text/css" media="screen" /><![endif]-->
        <!--[if IE 7]><link rel="stylesheet" href="../css/style.ie7.css" type="text/css" media="screen" /><![endif]-->
        <sj:head jqueryui="true" jquerytheme="south-street" compressed="false"/>
        <!--        <script type="text/javascript" src="../js/jquery.js"></script>-->
        <script type="text/javascript" src="../js/script.js"></script>


        <script src="../js/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
        <script src="../js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
        <link rel="stylesheet" href="../css/validationEngine.jquery.css" type="text/css"/>

        <script type="text/javascript" src="../js/evaluation.js"></script>

    </head>
    <body>
        <div id="art-main">
            <div class="cleared reset-box"></div>
            <%-- navigation and header --%>
            <jsp:include page="../components/headerComponent.jsp"/>


            <div class="cleared reset-box"></div>
            <div class="art-box art-sheet">
                <div class="art-box-body art-sheet-body">
                    <div class="art-layout-wrapper">
                        <div class="art-content-layout">
                            <div class="art-content-layout-row">
                                <div class="art-layout-cell art-content">
                                    <div class="art-box art-post">
                                        <div class="art-box-body art-post-body">
                                            <div class="art-post-inner art-article">
                                                <sj:dialog autoOpen="false" closeOnEscape="true" modal="true" id="messageDialog" title="Teacher-Class Evaluation System"
                                                           buttons="{
                                                           'Close':function() {  
                                                           $('#messageDialog').dialog('close');
                                                           }
                                                           }">
                                                </sj:dialog>
                                                <div style="clear:both; float: left; width: 100%;">
                                                    <sj:tabbedpanel id="administrationTabs">
                                                        <sj:tab id="scheduleTab"  target="scheduleDiv" label="Subject Schedules"/>
                                                        <sj:tab id="subjectsStudentTab"  target="subjectsStudentDiv" label="Subject Class List"/>
                                                        <div id="scheduleDiv">
                                                            <div style="clear:both; margin: 0; padding: 0; float: left; width: 100%;">

                                                                <s:url id="subjectscheduleurl1" action="../subject schedule/view"/>
                                                                <s:url id="editsubjectscheduleurl" action="../subject schedule/edit"/>
                                                                <s:url id="viewsubjectofferingurl" action="../college/view~option list"/>
                                                                <s:url id="viewinstructornameurl" action="../instructor/view~option list"/>
                                                                <s:url id="viewsubjectofferingnameurl" action="../subject offering/view~option list"/>
                                                                <s:url id="viewsubjectcodeurl" action="../subject/view~option list"/>
                                                                <sjg:grid
                                                                    id="gridSubjectSchedule"
                                                                    name="gridSubjectSchedule"
                                                                    caption="List of Subject Schedules"
                                                                    dataType="json"
                                                                    href="%{subjectscheduleurl1}"
                                                                    editurl="%{editsubjectscheduleurl}"
                                                                    gridModel="subjectScheduleList"
                                                                    rowNum="20"
                                                                    rowList="10,20,30,40,50" 
                                                                    width="640" 
                                                                    shrinkToFit="false"
                                                                    pager="true"
                                                                    loadingText="Requesting Data..."
                                                                    groupField="['subjectOfferingFullName']"
                                                                    groupColumnShow="[true]"
                                                                    groupCollapse="true"
                                                                    groupText="['<b>{0} - {1} Subject(s)</b>']"
                                                                    navigator="true"
                                                                    navigatorDelete="true"                                                                    
                                                                    navigatorAddOptions="{reloadAfterSubmit:true,afterSubmit:serverErrorCheck,bSubmit:'Save',closeAfterAdd:true,width:500}"
                                                                    navigatorEditOptions="{reloadAfterSubmit:true,afterSubmit:serverErrorCheck,bSubmit:'Save',closeAfterEdit:true,width:500}"
                                                                    navigatorDeleteOptions="{reloadAfterSubmit:true,afterSubmit:deleteErrorCheck,afterComplete:deleteMessageCheck}"
                                                                    >

                                                                    <sjg:gridColumn name="subjectScheduleID"
                                                                                    index="subjectScheduleID"
                                                                                    title="Subject Schedule ID"
                                                                                    hidden="true"
                                                                                    key="true"
                                                                                    />


                                                                    <sjg:gridColumn name="subjectOfferingFullName"
                                                                                    index="subjectOfferingFullName"
                                                                                    title="Subject Offering Name"
                                                                                    align="left"
                                                                                    editable="true"
                                                                                    edittype="select"
                                                                                    editoptions="{dataUrl:'%{viewsubjectofferingnameurl}'}"
                                                                                    editrules="{required: true}" 
                                                                                    width="200"
                                                                                    />
                                                                    <sjg:gridColumn name="subjectCode"
                                                                                    index="subjectCode"
                                                                                    title="Subject"
                                                                                    width="60"
                                                                                    editable="true"
                                                                                    edittype="select"
                                                                                    editoptions="{dataUrl:'%{viewsubjectcodeurl}'}"
                                                                                    editrules="{required: true}" 
                                                                                    />
                                                                    <sjg:gridColumn name="subjectDescription"
                                                                                    index="subjectDescription"
                                                                                    title="Description"
                                                                                    width="170"
                                                                                    />
                                                                    <sjg:gridColumn name="totalUnits"
                                                                                    index="tatalUnits"
                                                                                    title="Units"
                                                                                    align="center"
                                                                                    width="40"
                                                                                    />
                                                                    <sjg:gridColumn name="subjectSchedule"
                                                                                    index="subjectSchedule"
                                                                                    title="Schedule"
                                                                                    width="150"
                                                                                    editable="true"
                                                                                    editrules="{required:true}"
                                                                                    editoptions="{size:50, maxlength: 200}"
                                                                                    />
                                                                    <sjg:gridColumn name="instructorFullName"
                                                                                    index="instructorFullName"
                                                                                    title="Instructor"
                                                                                    width="150"
                                                                                    align="left"
                                                                                    editable="true"
                                                                                    edittype="select"
                                                                                    editoptions="{dataUrl:'%{viewinstructornameurl}'}"
                                                                                    editrules="{required: true}" 
                                                                                    />
                                                                    <sjg:gridColumn name="scheduleStatus"
                                                                                    index="scheduleStatus"
                                                                                    title="Status"
                                                                                    width="50"
                                                                                    align="center"
                                                                                    editable="true"
                                                                                    editrules="{required:true}"
                                                                                    edittype="select"
                                                                                    editoptions="{value:'1:1-Open for Evaluation;0:0-Closed'}"
                                                                                    />


                                                                </sjg:grid>
                                                            </div>
                                                        </div><!-- subject schedule div -->

                                                        <div id="subjectsStudentDiv" style="clear:both; float: left; width: 100%;">
                                                            <div style="clear:both; margin: 0; padding: 0; float: left; width: 100%;">

                                                                <s:url id="subjectstudenturl" action="../subject student/view~administration"/>
                                                                <s:url id="editsubjectstudenturl" action="../subject student/edit"/>
                                                                <s:url id="viewschedulenameurl" action="../subject schedule/view~option list"/>
                                                                <s:url id="viewstudentnameurl" action="../student/view~option list"/>
                                                                <sjg:grid
                                                                    id="gridClassList"
                                                                    name="gridClassList"
                                                                    caption="Subject Class List"
                                                                    dataType="json"
                                                                    href="%{subjectstudenturl}"
                                                                    editurl="%{editsubjectstudenturl}"
                                                                    gridModel="subjectStudentList"
                                                                    rowNum="20"
                                                                    rowList="10,20,30,40,50" 
                                                                    width="640"
                                                                    pager="true"
                                                                    groupField="['subjectOfferingFullName']"
                                                                    groupColumnShow="[true]"
                                                                    groupCollapse="true"
                                                                    groupText="['<b>{0} ({1} Student/s)</b>']"
                                                                    loadingText="Requesting Data..."
                                                                    navigator="true"
                                                                    navigatorAddOptions="{reloadAfterSubmit:true,afterSubmit:serverErrorCheck,bSubmit:'Save',closeAfterAdd:true,width:500}"
                                                                    navigatorEditOptions="{reloadAfterSubmit:true,afterSubmit:serverErrorCheck,bSubmit:'Save',closeAfterEdit:true,width:500}"
                                                                    navigatorDeleteOptions="{reloadAfterSubmit:true,afterSubmit:deleteErrorCheck,afterComplete:deleteMessageCheck}"
                                                                    >

                                                                    <sjg:gridColumn name="subjectStudentID"
                                                                                    index="subjectStudentID"
                                                                                    title="Student Subject ID"
                                                                                    hidden="true"
                                                                                    key="true"
                                                                                    />

                                                                    <sjg:gridColumn name="subjectOfferingFullName"
                                                                                    index="subjectOfferingFullName"
                                                                                    title="Subject"
                                                                                    width="150"
                                                                                    editable="true"
                                                                                    edittype="select"
                                                                                    editoptions="{dataUrl:'%{viewschedulenameurl}'}"
                                                                                    editrules="{required: true}"
                                                                                    />
                                                                    <sjg:gridColumn name="studentIDNumber"
                                                                                    index="studentIDNumber"
                                                                                    title="ID Number"
                                                                                    align="center"
                                                                                    width="50"
                                                                                    editable="false"
                                                                                    />
                                                                    <sjg:gridColumn name="studentFullName"
                                                                                    index="studentFullName"
                                                                                    title="Student"
                                                                                    align="left"
                                                                                    width="80"
                                                                                    editable="true"
                                                                                    edittype="select"
                                                                                    editoptions="{dataUrl:'%{viewstudentnameurl}'}"
                                                                                    />
                                                                    <sjg:gridColumn name="programCode"
                                                                                    index="programCode"
                                                                                    title="Course"
                                                                                    align="center"
                                                                                    width="50"
                                                                                    editable="false"
                                                                                    />
                                                                </sjg:grid>
                                                            </div>
                                                        </div><!-- subject's student div -->

                                                    </sj:tabbedpanel>
                                                </div>



                                            </div>
                                            <div class="cleared"></div>
                                        </div>
                                    </div>
                                    <div class="cleared"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="cleared"></div>
                    <%-- footer --%>
                    <jsp:include page="../components/footerComponent.jsp"/>
                    <div class="cleared"></div>
                </div>
            </div>
            <div class="cleared"></div>
        </div>
    </body>
</html>